
'===============================================================================
'  Generated From - VbNet_SQL_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  **
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class SqlClientEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'MustInherit' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can Override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  Public Class YourObject
'    Inherits _YourObject
'
'  End Class
'
'===============================================================================

' Generated by MyGeneration Version # (1.3.0.3)

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections
Imports System.Collections.Specialized

Imports MyGeneration.dOOdads

NameSpace ClassSigeco

Public MustInherit Class _si_proveedor
	Inherits SqlClientEntity

		Public Sub New() 
			Me.QuerySource = "si_proveedor"
			Me.MappingName = "si_proveedor"
		End Sub

	'=================================================================
	'  Public Overrides Sub AddNew()
	'=================================================================
	'
	'=================================================================
	Public Overrides Sub AddNew()
		MyBase.AddNew()
				
	End Sub
	
	Public Overrides Sub FlushData()
		Me._whereClause = nothing
		Me._aggregateClause = nothing		
		MyBase.FlushData()
	End Sub
	
		
	'=================================================================
	'  	Public Function LoadAll() As Boolean
	'=================================================================
	'  Loads all of the records in the database, and sets the currentRow to the first row
	'=================================================================
	Public Function LoadAll() As Boolean
	
		Dim parameters As ListDictionary = Nothing
		
		
    	Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_si_proveedorLoadAll]", parameters)
		
	End Function

	'=================================================================
	' Public Overridable Function LoadByPrimaryKey()  As Boolean
	'=================================================================
	'  Loads a single row of via the primary key
	'=================================================================
        Public Overridable Function LoadByPrimaryKey(ByVal IdProveedor As Integer) As Boolean

            Dim parameters As ListDictionary = New ListDictionary()
            parameters.Add(_si_proveedor.Parameters.IdProveedor, IdProveedor)


            Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_si_proveedorLoadByPrimaryKey]", parameters)

        End Function

#Region "Parameters"
        Protected Class Parameters

            Public Shared ReadOnly Property IdProveedor() As SqlParameter
                Get
                    Return New SqlParameter("@IdProveedor", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property Proveedor() As SqlParameter
                Get
                    Return New SqlParameter("@Proveedor", SqlDbType.NVarChar, 100)
                End Get
            End Property

            Public Shared ReadOnly Property Direccion() As SqlParameter
                Get
                    Return New SqlParameter("@Direccion", SqlDbType.NVarChar, 200)
                End Get
            End Property

            Public Shared ReadOnly Property Telefono1() As SqlParameter
                Get
                    Return New SqlParameter("@Telefono1", SqlDbType.NVarChar, 50)
                End Get
            End Property

            Public Shared ReadOnly Property Telefono2() As SqlParameter
                Get
                    Return New SqlParameter("@Telefono2", SqlDbType.NVarChar, 50)
                End Get
            End Property

            Public Shared ReadOnly Property Ruc() As SqlParameter
                Get
                    Return New SqlParameter("@Ruc", SqlDbType.NVarChar, 50)
                End Get
            End Property

            Public Shared ReadOnly Property Email() As SqlParameter
                Get
                    Return New SqlParameter("@Email", SqlDbType.NVarChar, 200)
                End Get
            End Property

            Public Shared ReadOnly Property Habilitado() As SqlParameter
                Get
                    Return New SqlParameter("@Habilitado", SqlDbType.Bit, 0)
                End Get
            End Property

            Public Shared ReadOnly Property ActualizadoPor() As SqlParameter
                Get
                    Return New SqlParameter("@ActualizadoPor", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property ActualizadoFecha() As SqlParameter
                Get
                    Return New SqlParameter("@ActualizadoFecha", SqlDbType.DateTime, 0)
                End Get
            End Property

        End Class
#End Region

#Region "ColumnNames"
        Public Class ColumnNames

            Public Const IdProveedor As String = "idProveedor"
            Public Const Proveedor As String = "proveedor"
            Public Const Direccion As String = "direccion"
            Public Const Telefono1 As String = "telefono1"
            Public Const Telefono2 As String = "telefono2"
            Public Const Ruc As String = "ruc"
            Public Const Email As String = "email"
            Public Const Habilitado As String = "habilitado"
            Public Const ActualizadoPor As String = "actualizadoPor"
            Public Const ActualizadoFecha As String = "actualizadoFecha"

            Public Shared Function ToPropertyName(ByVal columnName As String) As String

                If ht Is Nothing Then

                    ht = New Hashtable

                    ht(IdProveedor) = _si_proveedor.PropertyNames.IdProveedor
                    ht(Proveedor) = _si_proveedor.PropertyNames.Proveedor
                    ht(Direccion) = _si_proveedor.PropertyNames.Direccion
                    ht(Telefono1) = _si_proveedor.PropertyNames.Telefono1
                    ht(Telefono2) = _si_proveedor.PropertyNames.Telefono2
                    ht(Ruc) = _si_proveedor.PropertyNames.Ruc
                    ht(Email) = _si_proveedor.PropertyNames.Email
                    ht(Habilitado) = _si_proveedor.PropertyNames.Habilitado
                    ht(ActualizadoPor) = _si_proveedor.PropertyNames.ActualizadoPor
                    ht(ActualizadoFecha) = _si_proveedor.PropertyNames.ActualizadoFecha

                End If

                Return CType(ht(columnName), String)

            End Function

            Private Shared ht As Hashtable = Nothing
        End Class
#End Region

#Region "PropertyNames"
        Public Class PropertyNames

            Public Const IdProveedor As String = "IdProveedor"
            Public Const Proveedor As String = "Proveedor"
            Public Const Direccion As String = "Direccion"
            Public Const Telefono1 As String = "Telefono1"
            Public Const Telefono2 As String = "Telefono2"
            Public Const Ruc As String = "Ruc"
            Public Const Email As String = "Email"
            Public Const Habilitado As String = "Habilitado"
            Public Const ActualizadoPor As String = "ActualizadoPor"
            Public Const ActualizadoFecha As String = "ActualizadoFecha"

            Public Shared Function ToColumnName(ByVal propertyName As String) As String

                If ht Is Nothing Then

                    ht = New Hashtable

                    ht(IdProveedor) = _si_proveedor.ColumnNames.IdProveedor
                    ht(Proveedor) = _si_proveedor.ColumnNames.Proveedor
                    ht(Direccion) = _si_proveedor.ColumnNames.Direccion
                    ht(Telefono1) = _si_proveedor.ColumnNames.Telefono1
                    ht(Telefono2) = _si_proveedor.ColumnNames.Telefono2
                    ht(Ruc) = _si_proveedor.ColumnNames.Ruc
                    ht(Email) = _si_proveedor.ColumnNames.Email
                    ht(Habilitado) = _si_proveedor.ColumnNames.Habilitado
                    ht(ActualizadoPor) = _si_proveedor.ColumnNames.ActualizadoPor
                    ht(ActualizadoFecha) = _si_proveedor.ColumnNames.ActualizadoFecha

                End If

                Return CType(ht(propertyName), String)

            End Function

            Private Shared ht As Hashtable = Nothing

        End Class
#End Region

#Region "StringPropertyNames"
        Public Class StringPropertyNames

            Public Const IdProveedor As String = "s_IdProveedor"
            Public Const Proveedor As String = "s_Proveedor"
            Public Const Direccion As String = "s_Direccion"
            Public Const Telefono1 As String = "s_Telefono1"
            Public Const Telefono2 As String = "s_Telefono2"
            Public Const Ruc As String = "s_Ruc"
            Public Const Email As String = "s_Email"
            Public Const Habilitado As String = "s_Habilitado"
            Public Const ActualizadoPor As String = "s_ActualizadoPor"
            Public Const ActualizadoFecha As String = "s_ActualizadoFecha"

        End Class
#End Region

#Region "Properties"
        Public Overridable Property IdProveedor() As Integer
            Get
                Return MyBase.Getint(ColumnNames.IdProveedor)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.IdProveedor, Value)
            End Set
        End Property

        Public Overridable Property Proveedor() As String
            Get
                Return MyBase.Getstring(ColumnNames.Proveedor)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.Proveedor, Value)
            End Set
        End Property

        Public Overridable Property Direccion() As String
            Get
                Return MyBase.Getstring(ColumnNames.Direccion)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.Direccion, Value)
            End Set
        End Property

        Public Overridable Property Telefono1() As String
            Get
                Return MyBase.Getstring(ColumnNames.Telefono1)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.Telefono1, Value)
            End Set
        End Property

        Public Overridable Property Telefono2() As String
            Get
                Return MyBase.Getstring(ColumnNames.Telefono2)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.Telefono2, Value)
            End Set
        End Property

        Public Overridable Property Ruc() As String
            Get
                Return MyBase.Getstring(ColumnNames.Ruc)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.Ruc, Value)
            End Set
        End Property

        Public Overridable Property Email() As String
            Get
                Return MyBase.Getstring(ColumnNames.Email)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.Email, Value)
            End Set
        End Property

        Public Overridable Property Habilitado() As Boolean
            Get
                Return MyBase.Getbool(ColumnNames.Habilitado)
            End Get
            Set(ByVal Value As Boolean)
                MyBase.Setbool(ColumnNames.Habilitado, Value)
            End Set
        End Property

        Public Overridable Property ActualizadoPor() As Integer
            Get
                Return MyBase.Getint(ColumnNames.ActualizadoPor)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.ActualizadoPor, Value)
            End Set
        End Property

        Public Overridable Property ActualizadoFecha() As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.ActualizadoFecha)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.ActualizadoFecha, Value)
            End Set
        End Property


#End Region
	
	#Region "String Properties" 

		Public Overridable Property s_IdProveedor As String
			Get
				If Me.IsColumnNull(ColumnNames.IdProveedor) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.IdProveedor)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.IdProveedor)
				Else
					Me.IdProveedor = MyBase.SetintAsString(ColumnNames.IdProveedor, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Proveedor As String
			Get
				If Me.IsColumnNull(ColumnNames.Proveedor) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.Proveedor)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Proveedor)
				Else
					Me.Proveedor = MyBase.SetstringAsString(ColumnNames.Proveedor, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Direccion As String
			Get
				If Me.IsColumnNull(ColumnNames.Direccion) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.Direccion)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Direccion)
				Else
					Me.Direccion = MyBase.SetstringAsString(ColumnNames.Direccion, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Telefono1 As String
			Get
				If Me.IsColumnNull(ColumnNames.Telefono1) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.Telefono1)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Telefono1)
				Else
					Me.Telefono1 = MyBase.SetstringAsString(ColumnNames.Telefono1, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Telefono2 As String
			Get
				If Me.IsColumnNull(ColumnNames.Telefono2) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.Telefono2)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Telefono2)
				Else
					Me.Telefono2 = MyBase.SetstringAsString(ColumnNames.Telefono2, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Ruc As String
			Get
				If Me.IsColumnNull(ColumnNames.Ruc) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.Ruc)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Ruc)
				Else
					Me.Ruc = MyBase.SetstringAsString(ColumnNames.Ruc, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Email As String
			Get
				If Me.IsColumnNull(ColumnNames.Email) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.Email)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Email)
				Else
					Me.Email = MyBase.SetstringAsString(ColumnNames.Email, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Habilitado As String
			Get
				If Me.IsColumnNull(ColumnNames.Habilitado) Then
					Return String.Empty
				Else
					Return MyBase.GetboolAsString(ColumnNames.Habilitado)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Habilitado)
				Else
					Me.Habilitado = MyBase.SetboolAsString(ColumnNames.Habilitado, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_ActualizadoPor As String
			Get
				If Me.IsColumnNull(ColumnNames.ActualizadoPor) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.ActualizadoPor)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.ActualizadoPor)
				Else
					Me.ActualizadoPor = MyBase.SetintAsString(ColumnNames.ActualizadoPor, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_ActualizadoFecha As String
			Get
				If Me.IsColumnNull(ColumnNames.ActualizadoFecha) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.ActualizadoFecha)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.ActualizadoFecha)
				Else
					Me.ActualizadoFecha = MyBase.SetDateTimeAsString(ColumnNames.ActualizadoFecha, Value)
				End If
			End Set
		End Property


	#End Region  	

	#Region "Where Clause"
    Public Class WhereClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffWhereParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffWhereParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "TearOff's"
		Public class TearOffWhereParameter

			Public Sub New(ByVal clause As WhereClause)
				Me._clause = clause
			End Sub
		
	
			Public ReadOnly Property IdProveedor() As WhereParameter
				Get
					Dim where As WhereParameter = New WhereParameter(ColumnNames.IdProveedor, Parameters.IdProveedor)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Proveedor() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Proveedor, Parameters.Proveedor)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Direccion() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Direccion, Parameters.Direccion)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Telefono1() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Telefono1, Parameters.Telefono1)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Telefono2() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Telefono2, Parameters.Telefono2)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Ruc() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Ruc, Parameters.Ruc)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Email() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Email, Parameters.Email)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Habilitado() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Habilitado, Parameters.Habilitado)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property ActualizadoPor() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.ActualizadoPor, Parameters.ActualizadoPor)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property ActualizadoFecha() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.ActualizadoFecha, Parameters.ActualizadoFecha)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property


			Private _clause as WhereClause
		End Class
		#End Region	

		Public ReadOnly Property IdProveedor() As WhereParameter 
			Get
				If _IdProveedor_W Is Nothing Then
					_IdProveedor_W = TearOff.IdProveedor
				End If
				Return _IdProveedor_W
			End Get
		End Property

		Public ReadOnly Property Proveedor() As WhereParameter 
			Get
				If _Proveedor_W Is Nothing Then
					_Proveedor_W = TearOff.Proveedor
				End If
				Return _Proveedor_W
			End Get
		End Property

		Public ReadOnly Property Direccion() As WhereParameter 
			Get
				If _Direccion_W Is Nothing Then
					_Direccion_W = TearOff.Direccion
				End If
				Return _Direccion_W
			End Get
		End Property

		Public ReadOnly Property Telefono1() As WhereParameter 
			Get
				If _Telefono1_W Is Nothing Then
					_Telefono1_W = TearOff.Telefono1
				End If
				Return _Telefono1_W
			End Get
		End Property

		Public ReadOnly Property Telefono2() As WhereParameter 
			Get
				If _Telefono2_W Is Nothing Then
					_Telefono2_W = TearOff.Telefono2
				End If
				Return _Telefono2_W
			End Get
		End Property

		Public ReadOnly Property Ruc() As WhereParameter 
			Get
				If _Ruc_W Is Nothing Then
					_Ruc_W = TearOff.Ruc
				End If
				Return _Ruc_W
			End Get
		End Property

		Public ReadOnly Property Email() As WhereParameter 
			Get
				If _Email_W Is Nothing Then
					_Email_W = TearOff.Email
				End If
				Return _Email_W
			End Get
		End Property

		Public ReadOnly Property Habilitado() As WhereParameter 
			Get
				If _Habilitado_W Is Nothing Then
					_Habilitado_W = TearOff.Habilitado
				End If
				Return _Habilitado_W
			End Get
		End Property

		Public ReadOnly Property ActualizadoPor() As WhereParameter 
			Get
				If _ActualizadoPor_W Is Nothing Then
					_ActualizadoPor_W = TearOff.ActualizadoPor
				End If
				Return _ActualizadoPor_W
			End Get
		End Property

		Public ReadOnly Property ActualizadoFecha() As WhereParameter 
			Get
				If _ActualizadoFecha_W Is Nothing Then
					_ActualizadoFecha_W = TearOff.ActualizadoFecha
				End If
				Return _ActualizadoFecha_W
			End Get
		End Property

		Private _IdProveedor_W As WhereParameter = Nothing
		Private _Proveedor_W As WhereParameter = Nothing
		Private _Direccion_W As WhereParameter = Nothing
		Private _Telefono1_W As WhereParameter = Nothing
		Private _Telefono2_W As WhereParameter = Nothing
		Private _Ruc_W As WhereParameter = Nothing
		Private _Email_W As WhereParameter = Nothing
		Private _Habilitado_W As WhereParameter = Nothing
		Private _ActualizadoPor_W As WhereParameter = Nothing
		Private _ActualizadoFecha_W As WhereParameter = Nothing

			Public Sub WhereClauseReset()

			_IdProveedor_W = Nothing
			_Proveedor_W = Nothing
			_Direccion_W = Nothing
			_Telefono1_W = Nothing
			_Telefono2_W = Nothing
			_Ruc_W = Nothing
			_Email_W = Nothing
			_Habilitado_W = Nothing
			_ActualizadoPor_W = Nothing
			_ActualizadoFecha_W = Nothing
				Me._entity.Query.FlushWhereParameters()

			End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffWhereParameter
    End Class	

	Public ReadOnly Property Where() As WhereClause
		Get
			If _whereClause Is Nothing Then
				_whereClause = New WhereClause(Me)
			End If
	
			Return _whereClause
		End Get
	End Property
	
	Private _whereClause As WhereClause = Nothing	
#End Region	

#Region "Aggregate Clause"
    Public Class AggregateClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffAggregateParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffAggregateParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "AggregateParameter TearOff's"
		Public class TearOffAggregateParameter

			Public Sub New(ByVal clause As AggregateClause)
				Me._clause = clause
			End Sub
		
	
		Public ReadOnly Property IdProveedor() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.IdProveedor, Parameters.IdProveedor)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Proveedor() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Proveedor, Parameters.Proveedor)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Direccion() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Direccion, Parameters.Direccion)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Telefono1() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Telefono1, Parameters.Telefono1)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Telefono2() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Telefono2, Parameters.Telefono2)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Ruc() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Ruc, Parameters.Ruc)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Email() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Email, Parameters.Email)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Habilitado() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Habilitado, Parameters.Habilitado)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property ActualizadoPor() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.ActualizadoPor, Parameters.ActualizadoPor)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property ActualizadoFecha() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.ActualizadoFecha, Parameters.ActualizadoFecha)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property


			Private _clause as AggregateClause
		End Class
		#End Region	

		Public ReadOnly Property IdProveedor() As AggregateParameter 
			Get
				If _IdProveedor_W Is Nothing Then
					_IdProveedor_W = TearOff.IdProveedor
				End If
				Return _IdProveedor_W
			End Get
		End Property

		Public ReadOnly Property Proveedor() As AggregateParameter 
			Get
				If _Proveedor_W Is Nothing Then
					_Proveedor_W = TearOff.Proveedor
				End If
				Return _Proveedor_W
			End Get
		End Property

		Public ReadOnly Property Direccion() As AggregateParameter 
			Get
				If _Direccion_W Is Nothing Then
					_Direccion_W = TearOff.Direccion
				End If
				Return _Direccion_W
			End Get
		End Property

		Public ReadOnly Property Telefono1() As AggregateParameter 
			Get
				If _Telefono1_W Is Nothing Then
					_Telefono1_W = TearOff.Telefono1
				End If
				Return _Telefono1_W
			End Get
		End Property

		Public ReadOnly Property Telefono2() As AggregateParameter 
			Get
				If _Telefono2_W Is Nothing Then
					_Telefono2_W = TearOff.Telefono2
				End If
				Return _Telefono2_W
			End Get
		End Property

		Public ReadOnly Property Ruc() As AggregateParameter 
			Get
				If _Ruc_W Is Nothing Then
					_Ruc_W = TearOff.Ruc
				End If
				Return _Ruc_W
			End Get
		End Property

		Public ReadOnly Property Email() As AggregateParameter 
			Get
				If _Email_W Is Nothing Then
					_Email_W = TearOff.Email
				End If
				Return _Email_W
			End Get
		End Property

		Public ReadOnly Property Habilitado() As AggregateParameter 
			Get
				If _Habilitado_W Is Nothing Then
					_Habilitado_W = TearOff.Habilitado
				End If
				Return _Habilitado_W
			End Get
		End Property

		Public ReadOnly Property ActualizadoPor() As AggregateParameter 
			Get
				If _ActualizadoPor_W Is Nothing Then
					_ActualizadoPor_W = TearOff.ActualizadoPor
				End If
				Return _ActualizadoPor_W
			End Get
		End Property

		Public ReadOnly Property ActualizadoFecha() As AggregateParameter 
			Get
				If _ActualizadoFecha_W Is Nothing Then
					_ActualizadoFecha_W = TearOff.ActualizadoFecha
				End If
				Return _ActualizadoFecha_W
			End Get
		End Property

		Private _IdProveedor_W As AggregateParameter = Nothing
		Private _Proveedor_W As AggregateParameter = Nothing
		Private _Direccion_W As AggregateParameter = Nothing
		Private _Telefono1_W As AggregateParameter = Nothing
		Private _Telefono2_W As AggregateParameter = Nothing
		Private _Ruc_W As AggregateParameter = Nothing
		Private _Email_W As AggregateParameter = Nothing
		Private _Habilitado_W As AggregateParameter = Nothing
		Private _ActualizadoPor_W As AggregateParameter = Nothing
		Private _ActualizadoFecha_W As AggregateParameter = Nothing

		Public Sub AggregateClauseReset()

		_IdProveedor_W = Nothing
		_Proveedor_W = Nothing
		_Direccion_W = Nothing
		_Telefono1_W = Nothing
		_Telefono2_W = Nothing
		_Ruc_W = Nothing
		_Email_W = Nothing
		_Habilitado_W = Nothing
		_ActualizadoPor_W = Nothing
		_ActualizadoFecha_W = Nothing
			Me._entity.Query.FlushAggregateParameters()

		End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffAggregateParameter
    End Class	

	Public ReadOnly Property Aggregate() As AggregateClause
		Get
			If _aggregateClause Is Nothing Then
				_aggregateClause = New AggregateClause(Me)
			End If
	
			Return _aggregateClause
		End Get
	End Property
	
	Private _aggregateClause As AggregateClause = Nothing	
#End Region	

	Protected Overrides Function GetInsertCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_proveedorInsert]" 
	    
		CreateParameters(cmd)
		
		Dim p As SqlParameter
		p = cmd.Parameters(Parameters.IdProveedor.ParameterName)
		p.Direction = ParameterDirection.Output
    
		Return cmd 

  	End Function
	
	Protected Overrides Function GetUpdateCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_proveedorUpdate]" 
		
		CreateParameters(cmd) 
		    
		Return cmd
	
	End Function	
	
	Protected Overrides Function GetDeleteCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_proveedorDelete]" 
		
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.IdProveedor)
		p.SourceColumn = ColumnNames.IdProveedor
		p.SourceVersion = DataRowVersion.Current

  
		Return cmd
	
	End Function	
	
	Private Sub CreateParameters(ByVal cmd As SqlCommand)
	
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.IdProveedor)
		p.SourceColumn = ColumnNames.IdProveedor
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Proveedor)
		p.SourceColumn = ColumnNames.Proveedor
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Direccion)
		p.SourceColumn = ColumnNames.Direccion
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Telefono1)
		p.SourceColumn = ColumnNames.Telefono1
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Telefono2)
		p.SourceColumn = ColumnNames.Telefono2
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Ruc)
		p.SourceColumn = ColumnNames.Ruc
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Email)
		p.SourceColumn = ColumnNames.Email
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Habilitado)
		p.SourceColumn = ColumnNames.Habilitado
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.ActualizadoPor)
		p.SourceColumn = ColumnNames.ActualizadoPor
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.ActualizadoFecha)
		p.SourceColumn = ColumnNames.ActualizadoFecha
		p.SourceVersion = DataRowVersion.Current


	End Sub	

End Class

End NameSpace

